<?php
namespace app\Admin\model;

use think\Db;
use think\Model;

class User extends Model
{
	public function get_User($data)
	{
		return Db::name('admin')->where($data)->find();
	}

	public function get_Member($where='')
	{
		return Db::name('users')->where($where)->select();
	}

	public function get_MemberOne($id)
	{
		return Db::name('users')->where(array('user_id'=>$id))->find();
	}

	public function get_Rank()
	{
		return Db::name('rank')->select();
	}

	public function get_RankAdd($data)
	{
		return Db::table('tp_rank')->insert($data);
	}

	public function get_RankOne($id)
	{
		return Db::table('tp_rank')->where(array('rank_id'=>$id))->find();
	}

	public function get_RankEdit($data, $id)
	{
		return Db::table('tp_rank')->where(array('rank_id'=>$id))->update($data);
	}

	public function get_RankDel($id)
	{
		return Db::table('tp_rank')->where(array('rank_id'=>$id))->delete();
	}

	public function get_PointsList($where='')
	{
		return Db::name('points_log')->where($where)->select();
	}

	public function get_MemberLog($where='')
	{
		return Db::name('user_log')->where($where)->select();
	}

	public function get_Credential()
	{
		return Db::name('credential')->select();
	}

	//用户发表文章更改用户的文章数量
	public function getAddLike($id)
	{
		return Db::table('tp_users')->where(array('user_id'=>$id))->setInc('consult');
	}
}